import os

from ai.utils import utils_file


def get_scp_file(source_path: str = '/home/work_nfs6/lhma/wash_data/sample1000/res/muise_denoise',
                 output_scp_file: str = './output/wav.scp'):
    for root, dirs, files in os.walk(source_path):
        res_dic = {}
        for file in files:
            if file.endswith('.wav') or file.endswith('.WAV'):
                key = file.strip().split('_')[0] + "_" + file.strip().split('_')[1]
                wav_path = os.path.join(root, file)
                res_dic[key] = wav_path
        utils_file.write_dic_to_scp(res_dic, output_scp_file)
        break
